package com.geeguo.ebuilder.client.base.core.dictionary;

import com.geeguo.ebuilder.core.common.dictionary.IDictionary;

import java.util.Arrays;
import java.util.List;

public enum LogTypeEnum implements IDictionary {

    LOGIN(1, "登录"),
    INSERT(2, "新增"),
    UPDATE(3, "更新"),
    DELETE(4, "删除"),
    IMPORT(5, "导入"),
    EXPORT(6, "导出"),
    OTHER(99, "其他");

    private final int value;
    private final String label;

    LogTypeEnum(int value, String label) {
        this.value = value;
        this.label = label;
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public String getLabel() {
        return label;
    }

    public static List<LogTypeEnum> getEnumValues() {
        return Arrays.asList(values());
    }

    public static LogTypeEnum parse(int value) {
        for (LogTypeEnum item : LogTypeEnum.values()) {
            if (value == item.getValue()) {
                return item;
            }
        }
        return null;
    }
}